package com.atguigu.eduservice.client;

/**
 * @author shkstart
 * @create 2022-06-29 22:01
 */

import com.atguigu.commonutils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;


//@FeignClient("service-vod")不用熔断机制的写法
//不需要实现类，此接口远程调用：/eduvod/video/removeAiyVideo/{id}..fallback兜底，出错时执行
@FeignClient(name = "service-vod", fallback = VodFileDegradeFeignClient.class)//用于指定从哪个服务(删除视频的服务)中调用功能 ，名称与被调用的服务名保持一致
@Component//防止在其他位置注入CodClient时idea报错
public interface VodClient {

    @DeleteMapping(value = "/eduvod/video/removeAiyVideo/{id}")
    public R removeAiyVideo(@PathVariable("id") String id);//@PathVariable("一定要指定参数名称，否则出错")

    @DeleteMapping(value = "/eduvod/video/delete-batch")//List<String>要加String
    public R deleteBacht(@RequestParam("videoIdList") List<String> videoIdList);//@PathVariable("一定要指定参数名称，否则出错")

}
